package shuai.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import shuai.biz.UserBiz;
import shuai.model.User;

@Controller
@Scope(value="prototype")
@ParentPackage(value="struts-default")
public class UserAction extends BaseAction{
	@Resource(name="userBiz")
	private UserBiz userBiz;
	
	@Action(value="user_list",results={@Result(name="success",location="/list.jsp")})
	public String list(){
		List<User> list=userBiz.findAll();
		System.out.println("list========"+list);
		getRequest().setAttribute("list", list);
		return SUCCESS;
	}
	
	public UserBiz getUserBiz() {
		return userBiz;
	}

	public void setUserBiz(UserBiz userBiz) {
		this.userBiz = userBiz;
	}
	
	
}
